#pragma once

namespace AVUI {

class HybridDictionary : public Object
{
public:
    DECLARE_ELEMENT(HybridDictionary, Object);

    HybridDictionary();
    HybridDictionary(int initialSize);

    Object* GetItemAt(Object* pKey);
    void SetItemAt(Object* pKey, Object* pValue);

    void Remove(Object* pKey) { SetItemAt(pKey, NULL); }
    bool Contains(Object* pKey);

    TArrayPtr< TRefCountedPtr<Object> > get_Keys();

private:

    struct Entry
    {
        Entry() { }
        Entry(Object* pKey, Object* pValue) : Key(pKey), Value(pValue) { }

        TRefCountedPtr<Object> Key;
        TRefCountedPtr<Object> Value;
    };
    ItemStructList<Entry> m_entries;

};

typedef TArray< TRefCountedPtr<HybridDictionary> > HybridDictionaryArray;

}; // namespace AVUI
